package com.android.dongshouzhi.utils;

import android.view.View;
import android.widget.TextView;

/**
 * Created by Administrator on 2017/11/22.
 */

public class CommonUtils {

    /**
     *
     * @param tv  ￥99的View
     * @param addtv +号的View
     * @param str
     */
    public static void SetPriceViewHideOrVisible(TextView tv, TextView addtv, String str){
        if(str!=null) {
            Double doub = Double.parseDouble(str);
            if(doub!=0.0){
                tv.setVisibility(View.VISIBLE);
                addtv.setVisibility(View.VISIBLE);
                tv.setText("￥"+str);
            }else{
                tv.setVisibility(View.GONE);
                addtv.setVisibility(View.GONE);
            }
        }else{
            tv.setVisibility(View.GONE);
            addtv.setVisibility(View.GONE);
        }

    }
}
